package teach002;

import java.util.HashMap;
import java.util.Map;

import teach002.MapProto.MapProtoBean;

import com.google.protobuf.InvalidProtocolBufferException;

public class Main {
	public static void main(String[] args) throws InvalidProtocolBufferException {
		Map<String, String> values = new HashMap<String, String>();
		values.put("person01", "id01");
		values.put("person02", "id02");
		MapProtoBean bean = MapProto.MapProtoBean.newBuilder().putAllPersonId(values).build();
		byte[] byteArr = bean.toByteArray();
		bean = MapProtoBean.parseFrom(byteArr);
		for(String key : bean.getPersonId().keySet()){
			System.out.println(bean.getPersonId().get(key));
		}
	}
}
